package shellstation;
import java.sql.ResultSet;
import java.util.ArrayList;

public class UsrModel {

    private ArrayList listSize= new ArrayList();
    private ArrayList username= new ArrayList();
    private ArrayList userType= new ArrayList();



   /* public ArrayList getlistSize(){

        ResultSet rs;
        ReceiptController r= new ReceiptController();


        rs= r.getSizes();
        try{

            while( rs.next()) {
                String s=  rs.getString("size");
                listSize.add(s);

            }
        }
        catch(Exception e){
            e.printStackTrace();
        }

        return listSize;
    }*/

    public ArrayList getUser(String ut){

        ResultSet rs;
        UserController uc= new UserController();

        rs = uc.getuser3(ut);

        try{

            while( rs.next()) {
                String s=  rs.getString("username");
                username.add(s);


            }
        }
        catch(Exception e){
            e.printStackTrace();
        }

        return username;
    }

    public ArrayList getUser2(){

        ResultSet rs;
        UserController uc= new UserController();

        rs = uc.getuser4();

        try{

            while( rs.next()) {
                String s=  rs.getString("userType");
                userType.add(s);


            }
        }
        catch(Exception e){
            e.printStackTrace();
        }

        return userType;
    }

    public ArrayList getUser3(){

        ResultSet rs;
        UserController uc= new UserController();

        rs = uc.getuser4();

        try{

            while( rs.next()) {
                String s=  rs.getString("username");
                username.add(s);


            }
        }
        catch(Exception e){
            e.printStackTrace();
        }

        return username;
    }


    public ArrayList getUser1(String ut){

        ResultSet rs;
        UserController uc= new UserController();

        rs = uc.getuser3(ut);

        try{

            while( rs.next()) {
                String s=  rs.getString("userType");
                userType.add(s);


            }
        }
        catch(Exception e){
            e.printStackTrace();
        }

        return userType;
    }


}
